<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="common_css :: commonHeader('用户列表')"></head>
<body>
<!--搜索框-->
<form id="tabfrom" method="post">
    <div style="padding:2px" class="easyui-panel" title="数据查询">
        <table class="form-table">
            <tr>
                <td align="right" width="10%">所属机构：</td>
                <td align="left">
                    <input id="selOrgId" style="width:350px" class="easyui-combotree" multiple="multiple"
                           cascadeCheck="false" data-options="prompt:'==请选择==',panelHeight:'auto'"/>
                </td>
            </tr>
        </table>
        <table class="form-table">
            <tr>
                <td align="right" width="10%">登录名称：</td>
                <td align="left"><input id="loginId" style="width:150px" class="easyui-validatebox"></td>
                <td align="right" width="10%">用户姓名：</td>
                <td align="left"><input id="name" style="width:150px" class="easyui-validatebox"></td>
                <td align="right" width="10%">用户状态：</td>
                <td align="left">
                    <input id="selStatus" style="width:150px" class="easyui-combobox"
                           data-options="valueField:'value',textField:'showmsg',prompt:'==请选择==',panelHeight:'auto'"/>
                    <a class="easyui-linkbutton" iconCls='icon-search' onclick="doSearch();">查询</a>
                </td>
            </tr>
        </table>
    </div>
    <br>
</form>

<div id="toolbar">
    <shiro:hasPermission name="system:user:add">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-add"
           onclick="addUser()">添加</a>
    </shiro:hasPermission>
    <shiro:hasPermission name="system:user:edit">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-edit"
           onclick="editUser()">修改</a>
    </shiro:hasPermission>
    <shiro:hasPermission name="system:user:del">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-cancel"
           onclick="delUser()">删除</a>
    </shiro:hasPermission>
    <shiro:hasPermission name="system:user:lock">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-cut"
           onclick="updateIsUse('1')">锁定</a>
    </shiro:hasPermission>
    <shiro:hasPermission name="system:user:unlock">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-reload"
           onclick="updateIsUse('2')">解锁</a>
    </shiro:hasPermission>
    <shiro:hasPermission name="system:user:export">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-print"
           onclick="exprotFile()">导出</a>
    </shiro:hasPermission>
    <shiro:hasPermission name="system:user:role">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-redo"
           onclick="editUserRole()">角色管理</a>
    </shiro:hasPermission>
    <shiro:hasPermission name="system:user:resetPassword">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-chart-curve"
           onclick="resetPassword()">重置密码</a>
    </shiro:hasPermission>
</div>

<div id="dg"></div>

<div id="dlg" class="easyui-dialog" style="width:650px;height:500px"
     closed="true" modal="true" maximizable="true" resizable="true">


    <form id="myform" method="post">
        <div style="padding:20px">
            <table cellpadding="2px" cellspacing="0" class="form-table">
                <input type="hidden" value="" id="beforeOrganizationId" name="beforeOrganizationId"/>
                <input type="hidden" id="id" class="textbox" name="id">
                <tr>
                    <td>用户名：</td>
                    <td>
                        <input class="easyui-validatebox"
                               data-options="required:true" missingMessage="请输入用户名"
                               validType="chinese" name="name"/>
                    </td>
                    <td>登录名称：</td>
                    <td>
                        <input class="easyui-validatebox" data-options="required:true"
                               missingMessage="请输入登录名称"
                               validType="loginId['loginIdFirst','登录名称已经存在，请更换！']" name="loginId"/><!--新的-->
                        <input type="hidden" class="textbox" name="loginIdFirst" id="loginIdFirst"/><!--之前的-->
                    </td>
                </tr>
                <tr>
                    <td>性 别：</td>
                    <td>
                        <input type="radio" name="sex"
                               class="easyui-validatebox" value="1"><label>男</label></input>
                        <input type="radio" name="sex"
                               class="easyui-validatebox" value="2"><label>女</label></input>
                    </td>
                    <td>电邮地址：</td>
                    <td><input class="easyui-validatebox"
                               data-options="required:true" missingMessage="请输入邮件"
                               validType="email" invalidMessage="请填写正确的邮件格式" name="email"/></td>
                </tr>
                <tr>
                    <td>地 址：</td>
                    <td><input class="easyui-validatebox"
                               data-options="required:true" missingMessage="请输入地址" name="address"/></td>
                    <td>手机号码：</td>
                    <td><input class="easyui-validatebox"
                               data-options="required:true" missingMessage="请输入联系电话" validType="mobile"
                               name="phone"/></td>
                </tr>
                <tr>
                    <td>所属机构：</td>
                    <td colspan="3">
                        <input id="orgId" name="orgId" style="width:350px"
                               data-options="required:true,prompt:'==请选择==',panelHeight:'auto'"
                               class="easyui-combotree"
                               missingMessage="请维护机构信息" validType="comtreeValidate['orgId','请维护机构信息']"/>
                    </td>
                </tr>
                <tr>
                    <td>用户头像：</td>
                    <td colspan="3">
                        <input type="hidden" name="headSculpture">
                        <img title="点击上传LOGO" onclick="uploadimg.click();" alt="点击上传"
                             id="img" name="" width="120" height="120">

                    </td>
                </tr>
                <tr>
                    <td>用户说明：</td>
                    <td colspan="3">
                        <input class="easyui-textbox" name="description"
                               data-options="multiline:true" style="height:80px;width:350px"/>
                    </td>
                </tr>
            </table>
        </div>

    </form>
</div>

<!--用户角色-->
<div id="dlgRole" class="easyui-dialog" style="width:500px;height:400px"
     closed="true" modal="true" maximizable="true" resizable="true">
    <form id="myformRole" method="post">
        <input type="hidden" name="userId" id="userId">
        <div id="dgRole"></div>
    </form>
</div>


<div style="display: none;">
    <form id="subimg" enctype="multipart/form-data" method="post">
        <input accept=".png,.jpg,.gif,.xls" name="file" size="20" type="file"
               id="uploadimg" onchange="setImagePreview(this.value);">
    </form>
</div>


<div th:include="common_js :: commJS"></div>
<script type="text/javascript"
        th:src="@{/js/system/user.js}"></script>
</body>
</html>
